from typing import Union
from pydantic import BaseModel

class Movie(BaseModel):
    id: int
    title: str
    year: int
    rating: Union[float, str]
    director: str
    genre: list[str]
    poster_url: str
    description: str
    source: str = "maoyan"  # 电影来源："maoyan" 或 "tmdb"